<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
	<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 
	<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> 
<!DOCTYPE HTML>
<html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>18缸水-新闻列表</title>
    <link href="<%=request.getContextPath()%>/css/global.css" rel="stylesheet" type="text/css">
    <link href="<%=request.getContextPath()%>/css/contect.css" rel="stylesheet" type="text/css">
	<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/css/kkpager.css" />
	<script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery-1.7.1.js"></script>
    <script type="text/javascript" src="<%=request.getContextPath()%>/js/kkpager.min.js"></script>

</head>

<body>
    <!--头部开始-->
    <div class="bannercon">
        <div class="banner">
            <img src="<%=request.getContextPath()%>/image/logo.png">
        </div>
    </div>
    <!--正文开始-->
    <div class="maincon">
        <div class="main">
            <div class="navcon">
                <ul>
                    <li>
                        <a href="/" class="currentA" >首页</a>
                    </li>
                    <li>
                        <a href="<%=request.getContextPath()%>/client/news/getActivitylist.do" >活动</a>
                    </li>
                    <li>
                        <a href="<%=request.getContextPath()%>/client/news/getHdlist.do">互动</a>
                    </li>
                    <li>
                        <a href="<%=request.getContextPath()%>/client/news/getSchoolList.do">名校</a>
                    </li>
                    <li>
                        <a href="<%=request.getContextPath()%>/client/news/mentorship.do">师友</a>
                    </li>
                    <li>
                        <a href="<%=request.getContextPath()%>/client/news/getMagazineList.do" >杂志</a>
                    </li>
                </ul>
            </div>
            <div class="section1">
                <h5><a href="/">首页</a>&gt;&gt;<a href="<%=request.getContextPath()%>/client/news/getNewsBeans.do">资讯列表</a></h5>
                <div class="contain">
                    <div class="address">
                          
						      <div class="list_news_01">
				   <ul>
				      <c:if test="${fn:length(newsBeans)==0}">暂无数据</c:if>
				      <c:if test="${fn:length(newsBeans)>0}">
						<c:forEach items="${newsBeans}" var="news">
									<li class='bg' >
											<span class="date">${news.createtime }</span>
										<div class="ico"></div>
										<a href='<%=request.getContextPath()%>/client/news/getNewsDetail.do?newsid=${news.id}' title='${news.title}'>${news.title}</a>
									</li>
					 
                	 </c:forEach>
                      </c:if>
				    </ul>
				         <div class="clear"></div>
                           
                               <div id="kkpager"></div>
                               
						   </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!--主体结束-->
    <!--footer-->
    <div class="footercon">
        <div class="footer">
            <p>青少年书法&nbsp;&nbsp;&nbsp;&nbsp;版权所有2013-2013&nbsp;&nbsp;ICP备8888888号</p>
        </div>
    </div>
</body>
<script type="text/javascript">
function getParameter(name) { 
	var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); 
	var r = window.location.search.substr(1).match(reg); 
	if (r!=null) return unescape(r[2]); return null;
}

//init
$(function(){
	var totalPage =${PageBean.pagecount};
	var totalRecords = ${PageBean.recordscount};
	var pageNo = getParameter('p');
	if(!pageNo){
		pageNo = 1;
	}
	//初始化分页控件
	//有些参数是可选的，比如lang，若不传有默认值
	kkpager.init({
		pno : pageNo,
		//总页码
		total : totalPage,
		//总数据条数
		totalRecords : totalRecords,
		//链接前部
		hrefFormer : '<%=request.getContextPath()%>/client/news/getNewsBeans.do',
		//链接尾部
		hrefLatter : '',
		getLink : function(n){
			return this.hrefFormer + this.hrefLatter + "?p="+n;
		},
		lang : {
			prePageText : '上一页',
			nextPageText : '下一页',
			totalPageBeforeText : '共',
			totalPageAfterText : '页',
			totalRecordsAfterText : '条数据',
			gopageBeforeText : '转到',
			gopageButtonOkText : '确定',
			gopageAfterText : '页',
			buttonTipBeforeText : '第',
			buttonTipAfterText : '页'
		}
	});
	//生成
	kkpager.generPageHtml();
});
</script>
</html>
